package bupt.xixi.learning.beans;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class PropertyValues {

    private List<PropertyValue> propertyValues = new ArrayList<>();

    public void addPropertyValue(PropertyValue propertyValue) {
        this.propertyValues.add(propertyValue);
    }

    public PropertyValue getPropertyValue(String propertyName) {
        for (PropertyValue propertyValue : propertyValues) {
            if (propertyValue.getName().equals(propertyName)) return propertyValue;
        }
        return null;
    }
}
